package com.visitor.demo1;

import java.util.ArrayList;
import java.util.List;

//Context 环境角色
public class Context {

	List<Node> list = new ArrayList();
    public void add(Node node) {
        list.add(node);
    }
    public void visit(Visitor visitor) {
        for(Node node : list){
            node.accept(visitor);
        }
    }

}
